package com.eyas.im.server;

import com.eyas.im.server.nio.handler.AbstractNioServerSocketHandler;
import com.eyas.im.server.nio.handler.ConsoleServerHandler;

public class ServerConfiguration {
    private String hostname;
    private int port;
    private int eventThreadSize = 3; //用于处理具体通信事件的线程数量
    private long shutdownWaitTime = 10000L;//shutdown方法调用时，等待多长时间来保证资源能够安全释放
    private Class<? extends AbstractNioServerSocketHandler<?>> handlerClass = ConsoleServerHandler.class; //用于socket通信的处理器对象类型

    public ServerConfiguration() {

    }

    public ServerConfiguration(String hostname, int port) {
        this.hostname = hostname;
        this.port = port;
    }

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        this.hostname = hostname;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getEventThreadSize() {
        return eventThreadSize;
    }

    public void setEventThreadSize(int eventThreadSize) {
        this.eventThreadSize = eventThreadSize;
    }

    public Class<? extends AbstractNioServerSocketHandler<?>> getHandlerClass() {
        return handlerClass;
    }

    public void setHandlerClass(Class<? extends AbstractNioServerSocketHandler<?>> handlerClass) {
        this.handlerClass = handlerClass;
    }

    public long getShutdownWaitTime() {
        return shutdownWaitTime;
    }

    public void setShutdownWaitTime(long shutdownWaitTime) {
        this.shutdownWaitTime = shutdownWaitTime;
    }
}
